package cn.zhaosunny.soap;

import java.lang.reflect.Type;

import kotlin.coroutines.Continuation;

/**
 * @author zhaoyang 2021/12/7
 */

class InternalSoapCall {
    public static Object call(Continuation<Object> continuation, Soap soap, SoapRequest soapRequest, Type type) {
        soap.getCallFactory().setSoap(soap, soapRequest, type);
        try {
            return soap.getCallFactory()
                    .suspendCall(soap.getCallFactory(), soap, soapRequest, type, continuation);
        } catch (Exception e) {
            return SoapExtensionsKt.suspendAndThrow(e, continuation);
        }
    }
}
